import request from '@/utils/request'
import { method } from 'lodash'

// 查询入库信息列表
export function inStorageList(query) {
  return request({
    url: '/inStorage/queryPageList',
    method: 'get',
    params: query
  })
}

// 获取入库信息详细信息
export function inStorageDetails(inStorageId) {
  return request({
    url: `/inStorage/${inStorageId}`,
    method: 'get'
  })
}


// 保存车辆入库
export function insertCarInStorage(data) {
  return request({
    url: '/inStorage/insertCarInStorage',
    method: 'post',
    data: data
  })
}

// 提交车库入库
export function updateCarInStorage(data) {
  return request({
    url: '/inStorage/submit',
    method: 'post',
    data: data
  })
}

// 删除车库入库
export function deleteInStorage(ids) {
  return request({
    url: `/inStorage/${ids}`,
    method: 'post'
  })
}

// 查询出入库记录列表
export function storageRecordList(query) {
  return request({
    url: '/storageRecord/queryPageList',
    method: 'get',
    params: query
  })
}

// 查询强度信息
export function getQuotaProductByOrderCar(orderCode, carModelName) {
  return request({
    url: `/quota/quotaCalcSchemeProduct/getQuotaProductByOrderCar/${orderCode}/${carModelName}`,
    method: 'get',
  })
}

// 查询合格证
export function getPurchaseQualifiedCard(purchaseNo, vinNo) {
  return request({
    url: `/qualifiedCard/getPurchaseQualifiedCard/${purchaseNo}/${vinNo}`,
    method: 'get',
  })
}

// 查询gps信息
export function carGpsInstall(query) {
  return request({
    url: `/inStorage/getCarGpsInfo`,
    method: 'get',
    params: query
  })
}

// 查询gps信息
export function carGpsMonitoring(carId) {
  return request({
    url: `/inStorage/getCarGpsMonitoring/${carId}`,
    method: 'get',
  })
}

// 查询gps信息
export function carPrchaseTax(carId) {
  return request({
    url: `/inStorage/getCarPrchaseTax/${carId}`,
    method: 'get',
  })
}

// 查询保险
export function carInsurance(carId, type) {
  return request({
    url: `/inStorage/getCarInsurance/${carId}/${type}`,
    method: 'get',
  })
}

// 查询年检
export function carInspection(carId) {
  return request({
    url: `/inStorage/getCarInspection/${carId}`,
    method: 'get',
  })
}

// 查询年检时间
export function carInspectionNextTime(carId) {
  return request({
    url: `/inStorage/getInspectionNextTime/${carId}`,
    method: 'get',
  })
}

// 获取外部转租赁信息
export function externalublease(id) {
  return request({
    url: `/inStorage/getOutChange/${id}`,
    method: 'get'
  })
}


// 入库获取替车详细信息
export function replacementCar(orderCarId) {
  return request({
    url: `/replacementCar/${orderCarId}`,
    method: 'get'
  })
}

// 提交替车入库单
export function submitTc(data) {
  return request({
    url: '/replacementCar/submit',
    method: 'post',
    data: data
  })
} 